/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jsf.generator;

import jsf.generator.controller.JSFControllerWriter;

/**
 *
 * @author abosancic
 */
public class CommonJSFControllerGenerator {

    private String className;
    private String [] uniqueField;
    private String pckg;
    
    public CommonJSFControllerGenerator(String className) {
        this(className, "model.jsf");
    }
    
    public CommonJSFControllerGenerator(String className, String pckg) {
        this.className = className;
        this.pckg = pckg;
    }
    
    public void generateJSFController()
    {
        JSFControllerWriter c = new JSFControllerWriter();
        c.setPackageName(pckg);
        c.setClassName(className);
        c.setUniqueField(uniqueField);
        c.setImportPackages(new String[]{
                "com.etfbl.net.dao.*",
                "com.etfbl.net.dto.*",
                "java.io.Serializable",
                "java.util.ResourceBundle",
                "javax.faces.bean.SessionScoped",
                "javax.faces.bean.ManagedBean",
                "models.jsf.base.BaseController",
                "models.jsf.util.JsfUtil"
            });
        c.generateClass();
        
    }
    
    public String [] getUniqueField() {
        return uniqueField;
    }

    public void setUniqueField(String [] uniqueField) {
        this.uniqueField = uniqueField;
    }

}
